#include <math.h>

#define swap(a, b, T) do { T t; t = a; a = b; b = t;} while(0)

void bsort_int(int *array, unsigned int start, unsigned int stop)
{
	char done = 0;
	while(!done) {
		done = 1;
		int i;
		for(i = start + 1; i < stop; ++i)
			if(array[i] < array[i-1]) {
				swap(array[i], array[i-1], int);
                done = 0;
			}
	}

}
void bsort_double(double *array, unsigned int start, unsigned int stop)
{
	char done = 0;
	while(!done) {
		done = 1;
		int i;
		for(i = start + 1; i < stop; ++i)
			if(array[i] < array[i-1]) {
				swap(array[i], array[i-1], double);
				done = 0;
			}
    }
}
